<div class="container-fluid">
    <div id="failedBox" class="hide"></div>
    <div class="panel panel-default">
        <div class="panel-body">
            <br>{{$parentDocuments := .parent_documents}}{{$spaceId := .space_id}}{{$parentId := .parent_id}}
            <form class="form-horizontal" method="post" action="/document/save" onsubmit="return false">
                <input type="hidden" name="parent_id" value="{{$parentId}}">
                <input type="hidden" name="space_id" value="{{$spaceId}}">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"> * </span> 父文档</label>
                    <div class="col-sm-6 form-comment">
                        <span class="control-label">
                            {{range $parentDocument := $parentDocuments}}
                                {{if eq $parentDocument.parent_id "0"}}
                                    <strong><a href="/document/index?document_id={{$parentDocument.document_id}}" target="_parent">{{$parentDocument.name}}</a></strong>
                                {{else}}
                                    <strong> / <a href="/document/index?document_id={{$parentDocument.document_id}}" target="_parent">{{$parentDocument.name}}</a></strong>
                                {{end}}
                            {{end}}
                        </span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"> * </span>类型</label>
                    <div class="col-sm-5">
                        <div class="radio radio-inline radio-primary">
                            <input type="radio" name="type" id="radio-menu" value="1" checked="checked">
                            <label for="radio-menu"><i class="fa fa-file fa-fw"></i>页面</label>
                        </div>
                        <div class="radio radio-inline radio-primary">
                            <input type="radio" name="type" id="radio-controller" value="2">
                            <label for="radio-controller"><i class="fa fa-folder fa-fw"></i>目录</label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"> * </span> 名称</label>
                    <div class="col-sm-5">
                        <input type="text" name="name" class="form-control" placeholder="请输入文档名称" value="">
                    </div>
                    <div class="col-sm-4 form-comment">
                        <span class="text-danger"> * 不能包含 \ / : * ? " < > | 、非法字符</span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="button" onclick="Form.ajaxSubmit(this.form, true);" class="btn btn-primary">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>